Many software applications require, as input, one or more ranges of numbers. Merely by way of example, in a business application (such as an electronic commerce application, a financial application, enterprise resource planning (“ERP”) application, customer relationship management (“CRM”) application, supply chain management application, and/or the like), a set of business rules might be used to perform actions on business records according to the characteristics of the records. Different rules, then, might apply to different records, depending on the values of various data elements in those records. In particular, one business rule might apply to a set of records having a data element with a value that falls within a first range, while a different business rule might apply to records having data element with a value that falls within a second range.
Hence, in business software (as well as other software), the application of various rules or operations to data often requires the user to define a variable whose values consist of a set of ranges (upon which the rule or operation is dependent). For example, if a wine merchant developed a set of rules to automatically apply discounts to online purchases, one of the many variables that might be in that ruleset could depend on the quantity of the purchase, or number of bottles ordered. The values for QUANTITY, then, and the corresponding discounts, might include the following: a QUANTITY greater than 0 and less than 8 has no discount, a QUANTITY greater than or equal to 8 and less than 12 has a 2% discount, a QUANTITY equal to 12 has a 5% discount, a QUANTITY greater than 12 and less than 24 has an 8% discount and a QUANTITY greater than or equal to 24 has a 10% discount.
An important feature of the set of ranges in the example above is that it is continuous: It accounts for all nonzero values. Range continuity for a given variable is critical in the area of business rules because it enables the ruleset to respond to any occurrence of that variable. Without continuity, if the ruleset encounters values that are not defined in the variable's set of ranges, then an error will occur, thus breaking the ruleset. Consider, for example, a case in which, instead of the rules above, the wine merchant's e-commerce application had the following rules: a QUANTITY greater than 0 and less than 8 has no discount, a QUANTITY greater than 10 and less than 12 has a 2% discount, a QUANTITY equal to 12 has a 5% discount, a QUANTITY greater than 12 and less than 24 has an 8% discount, and a QUANTITY greater than or equal to 24 has a 10% discount. This set of ranges leaves a gap between 8 and 10, breaking the continuity of the ruleset; as a result, if a customer orders, say, 9 bottles of wine, the system will not know how to respond.
Translating the ranges for a variable into something that can be read by computers generally requires a user to enter the relevant values into the computer using mathematical comparison symbols (or other comparison operators). The following are examples of methods that individuals might use to rewrite the ranges defining QUANTITY for the first example above:                0<QUANTITY<8        8<=QUANTITY<12        QUANTITY=12        12<QUANTITY<24        24<=QUANTITY        0<x<8        8<=x<12        x=12        12<x<24        24<=x        (0,8)        [8,12)        12        (12,24)        otherwise        
Unfortunately, using such text-based methods to translate natural-language rules into a machine-readable format raises a host of problems. Merely by way of example, the system in question must either constrain users to one particular textual format for entering ranges or be able to handle many different formats. The former option places strain on the users if they have to adapt to an unfamiliar method, as well as on the user interface if it has to instruct users on what method to use; the latter option places strain on the developers and the system.
Moreover, such text-based lists are difficult to scan quickly, making it difficult to detect errors such as gaps. For this reason and others, text-based methods of defining a set of ranges are prone to errors. Among other problems, users may make typographical errors, in which they accidentally enter a number or comparison symbol incorrectly; errors of comprehension or reading, in which they either misunderstand or misread the comparison symbols (e.g., confusing the < symbol for the > symbol); and/or errors of omission, in which individuals forget to include one or more values in the set of ranges, leading to a broken set, such as when, for example, a user forgets to include an include an endpoint value in defining adjacent ranges.
For these reasons, among others, there is a need for a more intuitive facility to allow a user to define ranges of values (and/or to view such definitions) within the context of a software application.